//通知消息 包括物流丶积分和金额等等消息
'use strict';
import React,{Component} from 'react';
import Header from '../common/header';
import styles from '../style/styles';
import LogisticsInfo from '../order/logisticsInfo';//物流信息
import {
    View,
    Text,
    ScrollView,
    Image,
    TouchableOpacity
} from 'react-native';
export default class notifyInfo extends Component{
    // 构造
      constructor(props) {
        super(props);
        // 初始状态
        this.state = {
            infoList:[1,2,3,4,5,6,7,8]
        };
      }


    logisticsInfo(){
        let that= this;
        that.props.navigator.push({
            component:LogisticsInfo
        })
    }

    infoList(){
        let that = this;
        let infoList = that.state.infoList;
        let rows;
        let list=[];
        for(let item of infoList){
            rows=(
                <TouchableOpacity style={styles.notify_info_list} key={item} onPress={()=>this.logisticsInfo()}>
                    <View style={styles.info_time_wrap}>
                        <Text style={styles.time_txt}>2016-09-21 22:22</Text>
                    </View>
                    <View style={styles.info_list_bottom}>
                        <Text style={styles.info_list_txt}>哟~您购买的宝贝已成功签收啦!</Text>
                        <View style={styles.info_l_b}>
                            <Image
                                source={require('../imgs/banner.jpg')}
                                resizeMode={'cover'}
                                style={styles.info_img}
                            />
                            <View style={styles.info_txt_wrap}>
                                <Text style={styles.info_txt}>已签收啦,您在多商网XXX店购买的宝贝成功签收,拆开看看吧</Text>
                            </View>
                        </View>
                    </View>
                </TouchableOpacity>
            )
            list.push(rows)
        }
        return list;
    }

    render(){
        return(
            <View style={{flex:1,}}>
                <Header navigator={this.props.navigator}  initObj={{ title:'通知消息',id:2}}/>
                <ScrollView style={styles.bg_scrollview}>
                    <View style={styles.notify_info}>
                        {this.infoList()}
                    </View>
                </ScrollView>
            </View>
        )
    }
}


